home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Camelot
/
Camelot 098 (1990-12)(Swedish User Group of Amiga)(SE)(PD)[WB].zip
/
Camelot 098 (1990-12)(Swedish User Group of Amiga)(SE)(PD)[WB].adf
/
XLisp-Stat
/
Book
/
interpolation2.lsp
< prev
next >
Wrap
Lisp/Scheme
|
1990-10-11
|
798b
|
30 lines
; book pp.301-302
(require "data/stackloss")
(defun standardize (x)
(let ((x-bar (mean x))
(s (standard-deviation x)))
(/ (- x x-bar) s)))
(setf std-air (standardize air))
(setf std-temp (standardize temp))
(setf std-conc (standardize conc))
(setf std-loss (standardize loss))
(setf w (plot-points (list std-air std-conc std-loss std-temp)
:scale-type 'fixed))
(defun interpolate (p)
(let* ((alpha (* (/ pi 2) p))
(s (sin alpha))
(c (cos alpha))
(m (make-array '(4 4) :initial-element 0)))
(setf (aref m 0 0) c)
(setf (aref m 0 2) s)
(setf (aref m 1 1) c)
(setf (aref m 1 3) s)
(send w :transformation m)))
(setf slider (interval-slider-dialog '(0 1) :action #'interpolate))
(send w :add-subordinate slider)